﻿using System;
using System.ComponentModel.DataAnnotations;

namespace StudentManagement.Entities
{
    /// <summary>
    /// 用户信息实体类
    /// </summary>
    public class TbcUserInfo
    {
        [Key]
        public int TbcUserID { get; set; }

        [Required(ErrorMessage = "用户名是必填字段")]
        [StringLength(20, ErrorMessage = "用户名长度不能超过20个字符")]
        public string TbcUserName { get; set; }

        [Required(ErrorMessage = "密码是必填字段")]
        [StringLength(50, ErrorMessage = "密码长度不能超过50个字符")]
        public string TbcPassword { get; set; }

        [EmailAddress(ErrorMessage = "邮箱格式不正确")]
        [StringLength(100, ErrorMessage = "邮箱长度不能超过100个字符")]
        public string TbcEmail { get; set; }

        [Phone(ErrorMessage = "电话号码格式不正确")]
        [StringLength(15, ErrorMessage = "电话长度不能超过15个字符")]
        public string TbcPhone { get; set; }

        [StringLength(100, ErrorMessage = "地址长度不能超过100个字符")]
        public string TbcAddress { get; set; }

        public DateTime TbcRegDateTime { get; set; } = DateTime.Now;
    }
}